public class Pi {

	public static void main(String[] args) {
		int L = 100000;
		if (args.length == 1) {
			L = Integer.parseInt(args[0]);
		}
		int N = L / 4 + 1;

		int[] s = new int[N + 3];
		int[] w = new int[N + 3];
		int[] v = new int[N + 3];
		int[] q = new int[N + 3];
		int n = (int) (L / 1.39793 + 1);
		int k;

		w[0] = 16 * 5;
		v[0] = 4 * 239;

		for (k = 1; k <= n; k++) {
			div(w, 25, w, N);
			div(v, 57121, v, N);
			// div ( v, 239, v );
			sub(w, v, q, N);
			div(q, 2 * k - 1, q, N);

			if (k % 2 != 0)
				add(s, q, s, N);
			else
				sub(s, q, s, N);
		}

		System.out.printf("%d.", s[0]);
		for (k = 1; k < N; k++) {
			System.out.print(String.format("%04d", s[k]));
			// System.out.printf("%d", s[k]);
		}
		System.out.println();
		return;
	}

	public static void add(int[] a, int[] b, int[] c, int N) {
		int i, carry = 0;
		for (i = N + 1; i >= 0; i--) {
			c[i] = a[i] + b[i] + carry;
			if (c[i] < 10000) {
				carry = 0;
			} else {
				c[i] = c[i] - 10000;
				carry = 1;
			}
		}
	}

	public static void sub(int[] a, int[] b, int[] c, int N) {
		int i, borrow = 0;
		for (i = N + 1; i >= 0; i--) {
			c[i] = a[i] - b[i] - borrow;
			if (c[i] >= 0)
				borrow = 0;
			else {
				c[i] = c[i] + 10000;
				borrow = 1;
			}
		}
	}

	public static void div(int[] a, int b, int[] c, int N) {
		int i, tmp, remain = 0;
		for (i = 0; i <= N + 1; i++) {
			tmp = a[i] + remain;
			c[i] = tmp / b;
			remain = (tmp % b) * 10000;
		}
	}

}
